//文本框
function generateTextboxes(option) {
    // 清空之前生成的文本框
    var container=document.getElementById("textboxContainer").innerHTML = "";


    // 根据选项生成相应数量的文本框

    switch (option) {
        case "登录":
            var textbox1 = document.createElement("input");
            textbox1.setAttribute("type", "text");//生成的文本框的类型
            textbox1.setAttribute("placeholder", "输入登录的手机号/邮箱");//用于在文本框进行提示的
            textbox1.setAttribute("name", "accountUser");//后端访问此参数的name
            var textbox2 = document.createElement("input");
            textbox2.setAttribute("type", "text");
            textbox2.setAttribute("placeholder", "输入登录密码");
            textbox2.setAttribute("name", "passwordUser");
            document.getElementById("textboxContainer").appendChild(textbox1);//添加两个输入框在前端页面的"textboxContainer"标记处
            document.getElementById("textboxContainer").appendChild(textbox2);
            break;
        case "注册":
            var textbox1 = document.createElement("input");
            textbox1.setAttribute("type", "text");//生成的文本框的类型
            textbox1.setAttribute("placeholder", "输入注册的手机号/邮箱");//用于在文本框进行提示的
            textbox1.setAttribute("name", "accountUser");//后端访问此参数的name
            var textbox2 = document.createElement("input");
            textbox2.setAttribute("type", "text");
            textbox2.setAttribute("placeholder", "输入注册密码");
            textbox2.setAttribute("name", "passwordUser");
            document.getElementById("textboxContainer").appendChild(textbox1);//添加两个输入框在前端页面的"textboxContainer"标记处
            document.getElementById("textboxContainer").appendChild(textbox2);
            break;
        case "二维码刷新检测":
            break;
        case "循环登录以及登录上限检测":
            break;
        case "聊天列表上下滑动检测":
            break;
        case "全部已读":
            break;
        case "选择消息标记已读":
            break;
        case "选择消息删除":
            break;
        case "消息右滑置顶+消息左滑删除":
        case "左滑消息将消息标为已读":
            break;
        case "左滑消息将消息标为未读":
            break;
        case "长按消息预览":
            break;
        case "聊天列表按钮功能检测":
            break;
        case "接听电话":
            break;
        case "拒绝来电":
            break;
        case "来电超时未接听挂断":
            break;
        case "语音通话麦克风相机权限检测":
            break;
        case "语音通话麦克风、摄像头按钮功能检测+通话页面最小化功能检测":
            break;
        case "接听视频":
            break;
        case "超时自动挂断视频":
            break;
        case "视频通话麦克风相机权限检测":
            break;
        case "视频通话麦克风、摄像头按钮功能检测+通话页面最小化功能检测":
            break;
        default:
            break;
    }
}





// 填写要求生成
function generateRequirements(option) {
    var requirementsContainer = document.getElementById("requirementsContainer");
    requirementsContainer.innerHTML = ""; // 清空之前的要求说明

    var requirements = document.createElement("p");
    switch (option) {
        case "登录":
            requirements.innerHTML = "请确保手机号/邮箱格式已经注册过,并且密码正确";
            break;
        case "注册":
            requirements.innerHTML = "手机号码请填写大陆地区（+86）的格式";
            break;
        case "二维码刷新检测":
            requirements.innerHTML = "请在正常网络下进行";
            break;
        case "循环登录以及登录上限检测":
            requirements.innerHTML = "自动登录的账号区间为10...01~10...05";
            break;
        case "聊天列表上下滑动检测":
            requirements.innerHTML = "确保存在消息";
            break;
        case "全部已读":
            requirements.innerHTML = "确保当前至少存在一条未读消息";
            break;
        case "选择消息标记已读":
            requirements.innerHTML = "确保当前至少存在一条未读消息";
            break;
        case "选择消息删除":
            requirements.innerHTML = "确保当前至少存在一条消息";
            break;
        case "消息右滑置顶+消息左滑删除":
            requirements.innerHTML = "确保当前至少存在两条信息";
            break;
        case "左滑消息将消息标为已读":
            requirements.innerHTML = "确保当前至少存在一条未读消息";
            break;
        case "左滑消息将消息标为未读":
            requirements.innerHTML = "标记消息未读后请观察红点是否出现";
            break;
        case "长按消息预览":
            requirements.innerHTML = "确保至少存在一条消息";
            break;
        case "聊天列表按钮功能检测":
            requirements.innerHTML = "确保至少存在一条消息";
            break;
        case "接听电话":
            requirements.innerHTML = "麦克风权限确认已经开启，根据控制台提示信息进行操作";
            break;
        case "拒绝来电":
            requirements.innerHTML = "根据控制台提示信息进行操作";
            break;
        case "来电超时未接听挂断":
            requirements.innerHTML = "根据控制台提示信息进行操作";
            break;
        case "语音通话麦克风相机权限检测":
            requirements.innerHTML = "根据控制台提示信息进行操作";
            break;
        case "语音通话麦克风、摄像头按钮功能检测+通话页面最小化功能检测":
            requirements.innerHTML = "确保麦克风、相机权限已经开启，根据控制台提示信息进行操作";
            break;
        case "接听视频":
            requirements.innerHTML = "确保麦克风、相机权限已经开启，根据控制台提示信息进行操作";
            break;
        case "拒绝视频":
            requirements.innerHTML = "根据控制台提示信息进行操作";
            break;
        case "超时自动挂断视频":
            requirements.innerHTML = "根据控制台提示信息进行操作";
            break;
        case "视频通话麦克风相机权限检测":
            requirements.innerHTML = "根据控制台提示信息进行操作";
            break;
        case "视频通话麦克风、摄像头按钮功能检测+通话页面最小化功能检测":
            requirements.innerHTML = "确保麦克风权限和相机权限已开启，根据控制台提示信息进行操作";
            break;
        default:
            requirements.innerHTML = "";
            break;
    }
    requirementsContainer.appendChild(requirements);
}






//路径
function onChangeDropdown() {
    var select = document.getElementById("dropdown");
    var selectedOption = select.options[select.selectedIndex].text;
    generateTextboxes(selectedOption);
    generateRequirements(selectedOption); // 调用说明生成函数

    // 根据选择的选项动态设置表单的action属性
    var form = document.getElementById("myForm");
    form.method="post";



    switch (selectedOption) {
        case "登录":
            form.action = "/LoginAndRegistration/login";
            break;
        case "注册":
            form.action = "/LoginAndRegistration/registration";
            break;
        case "二维码刷新检测":
            form.action = "/LoginAndRegistration/QrCode";
            break;
        case "循环登录以及登录上限检测":
            form.action = "/LoginAndRegistration/loopLoginAndRestrict";
            break;
        case "聊天列表上下滑动检测":
            form.action = "/ChatListFeature/slideScreen";
            break;
        case "全部已读":
            form.action = "/ChatListFeature/allRead";
            break;
        case "选择消息标记已读":
            form.action = "/ChatListFeature/selectRead";
            break;
        case "选择消息删除":
            form.action = "/ChatListFeature/selectDeleteRead";
            break;
        case "消息右滑置顶+消息左滑删除":
            form.action = "/ChatListFeature/pinnedAndSlideDelete";
            break;
        case "左滑消息将消息标为已读":
            form.action = "/ChatListFeature/slideMarkRead";
            break;
        case "左滑消息将消息标为未读":
            form.action = "/ChatListFeature/slideMarkUnRead";
            break;
        case "长按消息预览":
            form.action = "/ChatListFeature/messagePreview";
            break;
        case "聊天列表按钮功能检测":
            form.action = "/ChatListButton/chatListButtonTest";
            break;
        case "接听电话":
            form.action = "/AnswerVoice/answerPhone";
            break;
        case "拒绝来电":
            form.action = "/AnswerVoice/refuseAnswer";
            break;
        case "来电超时未接听挂断":
            form.action = "/AnswerVoice/timeoutHangUp";
            break;
        case "语音通话麦克风相机权限检测":
            form.action = "/AnswerVoice/microphoneCameraAccess";
            break;
        case "语音通话麦克风、摄像头按钮功能检测+通话页面最小化功能检测":
            form.action = "/AnswerVoice/microphoneCameraMinimizationFeature";
            break;
        case "接听视频":
            form.action = "/AnswerVideo/answerVideo";
            break;
        case "拒绝视频":
            form.action = "/AnswerVideo/refuseAnswer";
            break;
        case "超时自动挂断视频":
            form.action = "/AnswerVideo/timeoutHangUp";
            break;
        case "视频通话麦克风相机权限检测":
            form.action = "/AnswerVideo/microphoneCameraAccess";
            break;
        case "视频通话麦克风、摄像头按钮功能检测+通话页面最小化功能检测":
            form.action = "/AnswerVideo/microphoneCameraMinimizationFeature";
            break;
        default:
            form.action = "";
            break;
    }



}
